<?php
/**
* 
*/
class Zhou_bannerController extends admin
{
    
    public $zhou_sima;
    function __construct()
    {
       parent::__construct();
       $this->zhou_sima = $this->model('zhou_sima');
    }
    //求职轮播图修改
    public function neeb_bannerAction(){
        $table = 'zhou_pic';
        $where = 'pic_id =1';
        $res = $this->zhou_sima->get_one($table,$where);
        if ($_POST) {
            $data = array();
            $data['pic_photo1'] = $_POST['photo1'];
            $data['pic_photo2'] = $_POST['photo2'];
            $data['pic_photo3'] = $_POST['photo3'];
            $data['pic_addtime'] = time();
            // var_dump($data);die;

            //便捷
                $edit = $this->zhou_sima->update_table($table,$data,$where);
          
            if ($edit) {
                $this->adminMsg(lang('success'),url('admin/zhou_banner/neeb_banner'),2,1,1);
            }
        }
        $this->view->assign('res',$res);
        $this->view->display('admin/zhou_neeb_banner');
    }
    //招聘轮播图修改
    public function jobs_bannerAction(){
        $table = 'zhou_pic';
        $where = 'pic_typeid = 2 and pic_id =6';
        $res = $this->zhou_sima->get_one($table,$where);
        if ($_POST) {
            $data = array();
            $data['pic_photo1'] = $_POST['photo1'];
            $data['pic_photo2'] = $_POST['photo2'];
            $data['pic_photo3'] = $_POST['photo3'];
            $data['pic_addtime'] = time();

            // if ($id) {//便捷
                $edit = $this->zhou_sima->update_table($table,$data,$where);
            /*}else{//增加
                $data['pic_typeid'] = 2;
                $edit = $this->zhou_sima->db_add($table,$data); 
            }*/

            if ($edit) {
                $this->adminMsg(lang('success'),url('admin/zhou_banner/jobs_banner'),2,1,1);
            }
        }
        $this->view->assign('res',$res);
        $this->view->display('admin/zhou_jobs_banner');
    }
}